/*********************************模块函数**************************************/
/**
 * 获取本地签到子程序
 */
function getSubPrograms() {
    var subPrograms = [];
    var fileList = files.listDir(files.cwd());
    for (var i = 0; i < fileList.length; i++) {
        var fileName = fileList[i];
        if (fileName.startsWith("子程序-") && fileName.endsWith("签到.js")) {
            subPrograms.push(fileName);
        }
    }
    return subPrograms;
}
/**
 * 运行指定子程序
 */
function runSubProgram(subProgram) {
    engines.execScriptFile(subProgram);
}
/**********************************主程序***************************************/
var subPrograms = getSubPrograms();
if (subPrograms.length > 0) {
    var i = dialogs.select("请选择签到子程序~~~", subPrograms);
    print(subPrograms[i]);
    runSubProgram(subPrograms[i]);
} else {
    print("没有找到任何子程序");
}